<?php
/**
 * @Notes:【】
 * @User: zwc
 * @Date: 2022-05-09 0:23
 */

namespace App\Event\Talk;


use App\Dao\User\UserDao;
use Hyperf\Utils\Contracts\Arrayable;

class ChatReadEvent implements Arrayable
{

    /**
     * @var int 接收人
     */
    public $friend_id;

    /**
     * @var int 用户ID
     */
    public $user_id;

    /**
     * TalkMessageEvent constructor.
     *
     * @param string $event_name
     * @param array $data
     */
    public function __construct($token, $friend_id)
    {
        [$user_id] = App(\App\Util\JwtAuth::class)->parseToken($token);
        $this->user_id = $user_id;
        $this->friend_id = $friend_id;
    }

    public function toArray(): array
    {
        return (array)$this;
    }


}